﻿
function sx() {
    $("#indexf0 img ").css("max-height", "80px");
}
function fd() {
    $("#indexf0 img ").css("max-height", "50px");
}

$(function () {
	
	var navstr=$('#__VIEWSTATE').val();
	var jsonstr=Onluy.DES.decrypt(navstr);
	var navlist=JSON.parse(jsonstr);
	var i=0,navhtml='';
	for( i=0;i< navlist.length;i++){
		var nav=navlist[i]; 
		navhtml+='<li class="indexmianleft00">  ';
		navhtml+='<p>'+nav.Type_Name+'</p>  ';
			navhtml+='<div style="clear: both; height: auto!important; min-height: 418px;">    ';
				navhtml+='</div>   ';
					navhtml+='</li>  ';
		
	}
	$('#menutop').html(navhtml);
    //动画
    $('.flexslider').flexslider({
        directionNav: true,
        pauseOnAction: false
    });
    //动画
    $('.flexslider-bra').flexslider({
        directionNav: true,
        pauseOnAction: false
    });
    //动画
    $('.flexslider-min').flexslider({
        directionNav: true,
        pauseOnAction: false
    });
      
    //首页产品图片特效
    $(".box .pic a img ").each(function (i) {
        this.onmouseover = function () {
            var base = $(this).parent().parent();
             
            var oldmr = parseInt( base.css("marginRight").replace('px','')); 

            base.animate({
                marginRight: oldmr>50?135:15,
                opacity: '0.7'
            } );
        }
        this.onmouseout = function () {
            var base = $(this).parent().parent();

            var oldmr = parseInt(base.css("marginRight").replace('px', ''));

            base.animate({
                marginRight: oldmr > 50 ? 130 : 10,
                opacity: '1'
            } );
        }
    });

    //手机页面的特效
    $(".box  a img ").each(function (i) {
        this.onmouseover = function () {
            var base = $(this).parent() ;

            var oldmr = parseInt(base.css("marginTop").replace('px', '')); 
            base.animate({
                marginTop: oldmr > 20 ? 35 : 15,
                opacity: '0.7'
            });
        }
        this.onmouseout = function () {
            var base = $(this).parent() ;

            var oldmr = parseInt(base.css("marginTop").replace('px', ''));

            base.animate({
                marginTop: oldmr > 20 ? 30 : 10,
                opacity: '1'
            });
        }
    });


    $(".fi_b_left .item .pic img").each(function (i) {
        this.onmouseover = function () {
            var base = $(this).parent(); 
            base.animate({
                marginLeft: 5,
                opacity: '0.7'
            });
        }
        this.onmouseout = function () {
            var base = $(this).parent(); 
            base.animate({
                marginLeft: 0,
                opacity: '1'
            });
        }
    });


    $("#lx_nav li ").each(function (i) {
        this.onmouseover = function () {
            //alert('#vouch_' + i);

            $("#lx_nav li ").attr('class', 'li02');
            $(this).attr('class', 'li01');

            $('.lx-con').css('display', 'none');
            $('#vouch_' + (i+1)).css('display', 'block');
        } 
    });

    $("#btnsearch").on("click", function () {
        var text = $('.lx-con:visible  input').val();
        if (text == '站内搜索' || text=='知道')return;
        $('#searchForm').attr('action', '../PHONEPRO/?text=' + text);
        $('#searchForm').submit();

    });


    //设置位置 
    $(".content-width").css({left:$(window).width()/2-600});


    try{
        $('#dock3').Fisheye(
                   {
                       maxWidth: 50,
                       items: 'a',
                       itemsText: 'span',
                       container: '.accordion3-container',
                       itemWidth: 75,
                       proximity: 70,
                       alignment: 'left',
                       valign: 'bottom',
                       halign: 'center'
                   }
               );
    }
    catch (e) { }
    //$("#nav .Nav_Root").each(function (i) {
    //    this.onmouseover = function () {
    //        var base = $(this);
    //        base.css({ color: '#fff', background: '#0e9be1' });

    //        var div_obj = base.children("div");
    //        var ul_obj = base.children("div").children("ul");
    //        div_obj.css({ display: 'none', top: base.position().top + base.height()-1, left: 0 });
    //        ul_obj.css({ top: 0, left: base.position().left - ul_obj.width() + 40 });
    //        div_obj.slideDown();
    //    }
    //    this.onmouseout = function () {
    //        var base = $(this);
    //        base.css({ color: '#3a3a3a', background: '#fff' });
    //        base.children("div").offset({ top: -1, left: -2000 });
    //    }
    //}); 
});